<template>
	<view class="body">
		<uni-collapse v-for="iten in obj">
			<uni-collapse-item :title="iten" :show-animation="true">
				<view class="content">
					<view class="ul" v-if="wbhotlist[iten][0].title">
						<view class="li" v-for="(item,index) in wbhotlist[iten]" :key="index">
							<view class="" @click="push_href(item.href)">
								<text class="tit">{{item.title}}</text>
								<text class="hotnum">{{item.hot}}</text>
							</view>
						</view>
					</view>
					<view class="li" v-else style="text-align: center;padding:20px;">
						暂无信息
					</view>
				</view>
			</uni-collapse-item>
		</uni-collapse>
	</view>
</template>

<script>
	import {
		wbhot
	} from '@/api/moyuren.js'
	export default {
		data() {
			return {
				wbhotlist: [],
				obj: []
			}
		},
		mounted() {
			this.get_movies()
		},
		methods: {
			push_href(url){
				uni.navigateTo({
					url:'../erweima/more?url='+url
				})
			},
			get_movies() {
				wbhot().then(res => {

					for (let key in res.data.result) {
						this.obj.push(key)
						console.log(key)
					}
					this.wbhotlist = res.data.result
				})
			}
		}
	}
</script>

<style scoped>
	.ul {
		width: 100%;
	}

	.ul .li {
		padding: 10rpx 15rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		background: #f1f1f1;
		margin-top: 15rpx;
	}

	.ul .li .tit {
		font-size: 26rpx;
		color: #333;
	}

	.ul .li .hotnum {
		font-size: 26rpx;
		color: #b94e48;
	}
</style>